/**
 * Filename : VSClientHandler.java
 * Author : morris
 * Creation time : 2013-4-18 上午10:45:09
 * Description : 
 */
package cn.com.sbell.vss.csg.heartbeat;

import org.apache.mina.common.IoHandlerAdapter;
import org.apache.mina.common.IoSession;
import org.apache.mina.common.RuntimeIOException;
import org.apache.mina.util.SessionLog;

public class VSHeartBeatHandler extends IoHandlerAdapter {
	private Object msg;

	public VSHeartBeatHandler(Object msg) {
		System.out.println("VSHeartBeatHandler Construct...");
		this.msg = msg;
	}

	public void sessionOpened(IoSession session) {
		System.out.println("sessionOpened...");
		session.write(this.msg);
	}

	public void messageReceived(IoSession session, Object message) {
		System.out.println("Received message!");
		/*ResponseInfoToVS rm = (ResponseInfoToVS) message;
		SessionLog.debug(session, rm.toString());
		System.out.println("message is: " + rm.toString());
		session.write(rm);*/
	}

	public void exceptionCaught(IoSession session, Throwable cause) {
		session.close();
	}

}
